package com.jsjosem.aftersales.enums;

import cn.hutool.core.util.StrUtil;

public enum WorkOrderStatusEnum {

    CREATED("已创建"),
    ASSIGNED("已指派"),
    ACCEPTED("已接受"),
    STARTED("已开始"),
    COMPLETED("已完成"),
    ;
    private final String desc;

    WorkOrderStatusEnum(String desc) {
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    public static WorkOrderStatusEnum getEnum(String desc) {
        for (WorkOrderStatusEnum value : values()) {
            if (StrUtil.equals(value.getDesc(), desc)) {
                return value;
            }
        }
        return null;
    }
}
